import 'package:android_dynamic_icon/android_dynamic_icon.dart';
import 'package:get/get.dart';

class ChangeDesktopController extends GetxController {
  var index = 0.obs;

  final _androidDynamicIconPlugin = AndroidDynamicIcon();
  final List<String> iconList = [
    'MainActivity',
    'IconOne',
    'IconTwo',
    'IconThree',
    'IconFour',
    'IconFive',
    'IconSix',
    'IconSeven'
  ];

  Future<void> changeIcon(int index) async {
    await _androidDynamicIconPlugin
        .changeIcon(classNames: [iconList[index], '']);
  }

  @override
  void onInit() {
    AndroidDynamicIcon.initialize(classNames: iconList);
    super.onInit();
  }
}
